package com.yanqu.road.entity.cricket.court;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.sql.Types;
import java.util.HashSet;
import java.util.Set;

@FieldTypeAnnotation(tableName = "t_c_cricket_court_lock_group")
public class CricketCourtLockGroup extends DataObject {

    @FieldTypeAnnotation(desc = "轮次")
    private int round;

    @FieldTypeAnnotation(desc = "分组id")
    private int groupId;

    @FieldTypeAnnotation(desc = "服务器列表", sqlType = Types.LONGVARCHAR)
    private Set<Long> serverList = new HashSet<>();

    @FieldTypeAnnotation(desc = "锁定分组时间")
    private long lockTime;

    public int getRound() {
        return round;
    }

    public void setRound(int round) {
        if (this.round != round) {
            this.round = round;
            this.setUpdateOption();
        }
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        if (this.groupId != groupId) {
            this.groupId = groupId;
            this.setUpdateOption();
        }
    }

    public Set<Long> getServerList() {
        return serverList;
    }

    public void setServerList(Set<Long> serverList) {
        if (serverList == null) {
            return;
        }
        this.serverList = serverList;
        this.setUpdateOption();
    }

    public long getLockTime() {
        return lockTime;
    }

    public void setLockTime(long lockTime) {
        if (this.lockTime != lockTime) {
            this.lockTime = lockTime;
            this.setUpdateOption();
        }
    }
}
